#define  _CRT_SECURE_NO_WARNINGS  1
#include <stdio.h>
int main()
{
	int m, n;
	scanf("%d %d", &m, &n);
	int a[10][10] = {0};
	int i, j;
	
	for (i = 0; i < m; i++)
	{
		int s = 0;
		for (j = 0; j < n; j++)
		{
			scanf("%d", &a[i][j]);
			s = a[i][j] + s;
		}
		printf("%d\n", s);
	}

	return 0;
}